import  Vue from  'vue'
import Login from '@/views/Login'
import My from  '@/views/My'
import  Order from '@/views/Order'
import Sort from '@/views/Sort'

//引入VueRouter
import VueRouter from 'vue-router'
//让vue使用vuerouter 这个插件，vue的插件想要生效必须调用一个方法 
Vue.use(VueRouter)

// 创建路由对象
const  router = new VueRouter({
    routes:[
        {
     path: '/',//网页默认打开, 匹配路由"/", 强制切换到"/login"上
     redirect:'/login'//表示如果路径是 / ,会自动跳到 /find
        },
        {
            path: '/login',
            name:'Login',
            component: Login
        },
        {
            path: '/sort',
             name:'Sort',
            component: Sort
        },
        {
            path: '/order',
            name:'Order',
            component: Order
        },
        {
            path: '/my',
            name: 'My',
            component: My
        },
    ]
})
export default router